package com.zzg.srb.sms.utils;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Data
@Component
@ConfigurationProperties(prefix = "aliyun.sms")
public class SmsProperties implements InitializingBean {

    private String accessKeyId;

    private String accessKeySecret;

    public static String ACCESSKEYID;

    public static String ACCESSKEYSECRET;

    //实现InitializingBean接口，在属性赋值完成之后调用
    @Override
    public void afterPropertiesSet() throws Exception {
        ACCESSKEYID = accessKeyId;
        ACCESSKEYSECRET = accessKeySecret;
    }
}
